package com.simple.datax.flow.dao.ibatis.impl;
import com.simple.datax.flow.dao.ibatis.FlowDao;
import com.simple.datax.flow.dao.ibatis.model.Flow;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class FlowDaoImpl extends SqlMapClientDaoSupport implements
		FlowDao {

	public FlowDaoImpl() {
		super();
	}

	/**
	 * 根据流程ID获取流程信息
	 * @param flowid
	 * @return
	 */
	public Flow getFlowById(String flowid) {
		Flow flow = null;
		Object obj = getSqlMapClientTemplate().queryForObject(
				"getFlowById", flowid);
		if(obj!=null){			 
			flow = (Flow)obj;
		}
		return flow;
	}

//	@Override
//	public String getFlowTemplateIdByFlowId(String flowid) {
//		String flowTmpId = null;
//	    flowTmpId = (String)getSqlMapClientTemplate().queryForObject("getFlowTemplateIdByFlowId",flowid);
//		return flowTmpId;
//	}

	@Override
	public String getFlowidByTaskid(String taskid) {
		String flowid = (String)getSqlMapClientTemplate().queryForObject("getFlowidByTaskid",taskid);
		return flowid;
	}

}